import request from "@/utils/request";

export function queryShopByPage(data) {
    return request({
        url: '/front/cultureShop',
        method: 'GET',
        params: {
            data
        }
    })
}

export function queryShopById(data) {
    return request({
        url: '/front/cultureShop/' + data,
        method: 'GET'
    })
}

export function queryProductByShop(data) {
    return request({
        url: '/front/cultureProduct/shopId/' + data,
        method: 'GET'
    })
}

export function queryProductById(data) {
    return request({
        url: '/front/cultureProduct/' + data,
        method: 'GET'
    })
}

export function collectProduct({userId, productId}) {
    return request({
        url: '/front/cultureProductCollect',
        method: 'POST',
        params: {
            userId,
            productId
        }
    })
}

export function addShoppingCart({userId, productId}) {
    return request({
        url: '/front/cultureShoppingCart',
        method: 'POST',
        params: {
            userId,
            productId
        }
    })
}

export function queryCollectByPage({page, size,userId}) {
    return request({
        url: '/front/cultureProductCollect',
        method: 'GET',
        params: {
            page,
            size,
            userId
        }
    })
}

export function removeCollect({userId, productId}) {
    return request({
        url: '/front/cultureProductCollect',
        method: 'DELETE',
        params: {
            userId,
            productId
        }
    })
}

export function queryShoppingCartByPage({page,size,userId}) {
    return request({
        url: '/front/cultureShoppingCart',
        method: 'GET',
        params: {
            page,
            size,
            userId
        }
    })
}


export function removeShoppingCart({userId, productId}) {
    return request({
        url: '/front/cultureShoppingCart',
        method: 'DELETE',
        params: {
            userId,
            productId
        }
    })
}

export function queryOrderByPage({page,size,userId}) {
    return request({
        url: '/front/cultureOrder',
        method: 'GET',
        params: {
            page,
            size,
            userId
        }
    })
}

export function addOrder({userId, productId}) {
    return request({
        url: '/front/cultureOrder',
        method: 'POST',
        params: {
            userId,
            productId
        }
    })
}
